<?php
error_reporting(7);

require "global.php";

if (!isset($_GET[action])) {
    $_GET[action]="frames";
}

if ($_GET[action]=="frames") {
?>
    <html>
    <head>
    <title>eNet Recruiter Web System Version  <?php echo $configuration[version]; ?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset;?>">
    </head>
    <frameset rows="24,*" frameborder="NO" border="0" framespacing="0" cols="*">
      <frame name="head" scrolling="NO" noresize src="index.php?action=top" >
      <frameset cols="200,*" frameborder="NO" border="0" framespacing="0" rows="*">
        <frame name="toc" scrolling="YES" noresize src="menu.php">
        <frame name="content" src="index.php?action=main">
      </frameset>
    </frameset>
    <noframes><body bgcolor="#FFFFFF" text="#000000">
    </body></noframes>
    </html>
<?php
}

if ($_GET[action]=="top"){
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset;?>">
<link rel="stylesheet" href="cp.css" type="text/css">
<style type="text/css">
<!--
a:link,a:active,a:visited {  color: #000000; text-decoration: none; font-family: Tahoma,MS Shell Dlg,宋体; font-size : 9pt;}
a:hover { color: #000000; }
-->
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableoutline">
  <tr>
    <td width="30%" class=tbhead ><a href="#" >eNet Recruiter Web System <?php echo $configuration[version]; ?></a></td>
    <td align="center" class=tbhead></td>
    <td align="right" width="30%" class=tbhead><a href="user.php?action=logout">Logout</a></td>
  </tr>
</table>
</body>
</html>

<?php
}

if ($_GET[action]=="main"){
    cpheader();

    $usergroup = $DB->fetch_one_array("SELECT count(usergroupid) AS count FROM ".$db_prefix."usergroup");
    $user = $DB->fetch_one_array("SELECT count(userid) AS count FROM ".$db_prefix."user");


    $onlineusers = $DB->query("SELECT * FROM ".$db_prefix."session WHERE expiry>".time()." GROUP BY ipaddress");
    $onlineuser = $DB->num_rows($onlineusers);

    if (function_exists('ini_get')){
        $onoff = ini_get('register_globals');
    } else {
        $onoff = get_cfg_var('register_globals');
    }
    if ($onoff){
        $onoff="On";
    }else{
        $onoff="Off";
    }
    if (function_exists('ini_get')){
        $upload = ini_get('file_uploads');
    } else {
        $upload = get_cfg_var('file_uploads');
    }
    if ($upload){
        $upload="Yes";
    }else{
        $upload="No";
    }

?>
  <h3 align="center">Welcome <?=$_SESSION[pauserinfo][username];?></h3>

  <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
      <td>

        <table class="tableoutline" cellpadding=4 cellspacing=1 width="100%" border="0">
          <tr>
            <td height="20" class=tbhead colspan="2">Quick Search</td>
          </tr>
          <form method="get" action="./user.php">
          <tr nowrap>
              <td width="50%"> Search User: </td>
              <td>
                <input  type="text" name="username" size="35" maxlength="50" value="">
                <input type="submit" value="Search" class="bginput button-secondary">
                <input type="hidden" name="action" value="dosearch">
              </td>
          </tr>
           </form>
        </table>
        <br>
        <br>

        <table class="tableoutline" cellpadding=4 cellspacing=1 width="100%" border="0">
          <tr>
            <td height="20" class=tbhead colspan="2">System Information</td>
          </tr>
            <tr >
              <td width="50%"><font class="normalfont">Server Software: <?php echo $_SERVER["SERVER_SOFTWARE"];?> </font></td>
              <td width="50%"><font class="normalfont">Server System: <?php echo defined('PHP_OS') ? PHP_OS : '未知';?></font></td>
            </tr>
            <tr >
              <td width="50%"><font class="normalfont">PHP Edition: <?php echo phpversion();?> </font></td>
              <td width="50%"><font class="normalfont">MySQL Edition: <?php echo mysql_get_server_info();?></font></td>
            </tr>
            <tr>
              <td width="50%"><font class="normalfont">register_globals: <?php echo $onoff;?></font></td>
              <td width="50%"><font class="normalfont">Files Upload: <?php echo $upload; ?> </font></td>
            </tr>
            <tr>
              <td ><font class="normalfont">Server Address: <?php echo $_SERVER[SERVER_ADDR];?></font></td>
              <td width="50%"><font class="normalfont">Server Time Zone: <?php echo date("T",time()); ?> </font></td>
            </tr>
        </table>
        
        </td>
      </tr>
   </table>
<?php
   cpfooter();
}
?>